<template>
  <div class="index">
    <x-header class="header" :left-options="{showBack: false}">主页</x-header>
    <div class="topHolder"></div>
    <group-title>基础操作</group-title>
    <grid :cols="4">
      <grid-item class="indexIcon" v-for="(item,index) in baseMenusList" :key="index" v-if="item.auth" :link="item.path">
        <i class='iconfont' :class="[item.icon,item.color]"></i><br/>
        <div class="text" v-html="item.name"></div>
      </grid-item>
    </grid>
    <group-title>一般统计</group-title>
    <grid :cols="4">
      <grid-item class="indexIcon" v-for="(item,index) in normalStatisticsMenusList" :key="index" v-if="item.auth" :link="item.path">
        <i class='iconfont' :class="[item.icon,item.color]"></i><br/>
        <div class="text" v-html="item.name"></div>
      </grid-item>
    </grid>
    <group-title>业绩&排行统计</group-title>
    <grid :cols="4">
      <grid-item class="indexIcon" v-for="(item,index) in performanceMenusList" :key="index" v-if="item.auth" :link="item.path">
        <i class='iconfont' :class="[item.icon,item.color]"></i><br/>
        <div class="text" v-html="item.name"></div>
      </grid-item>
    </grid>
  </div>
</template>

<script>
  import { Badge, Grid, GridItem, GroupTitle } from 'vux'
  import {message} from "../common/util";

  export default {
    name: 'index',
    components: {
      Badge,
      Grid,
      GridItem,
      GroupTitle
    },
    data () {
      return {
        baseMenusList:{
          'subscribeManager_boss':{'auth':true,'name':'预订管理','path':{ path: '/subscribeManager'},'icon':'icon-yudingxinxi','color':'red'},
          'presentManager_boss':{'auth':true,'name':'酒水赠送管理','path':{ path: '/presentManager'},'icon':'icon-zengsong2','color':'blue'},
          'setting_boss':{'auth':true,'name':'个人设置','path':{ path: '/setting'},'icon':'icon-kehuguanli1','color':'green'}
        },
        normalStatisticsMenusList:{
          'turnoverStatistics_boss':{'auth':true,'name':'营业额统计','path':{ path: '/turnoverStatistics'},'icon':'icon-yeji','color':'orange'},
          'todaySelfHelpCustomer_boss':{'auth':true,'name':'今日自来客','path':{ path: '/todaySelfHelpCustomer'},'icon':'icon-kehujingliguanli-','color':'green'},
          'operatingRevenue_boss':{'auth':true,'name':'总营业收入','path':{ path: '/operatingRevenue'},'icon':'icon-xiaofeisongquan','color':'blue'},
          'turnoverRatio_boss':{'auth':true,'name':'翻台率','path':{ path: '/turnoverRatio'},'icon':'icon-shouxintongguoshuai','color':'red'},
          'openRatio_boss':{'auth':true,'name':'开台率','path':{ path: '/openRatio'},'icon':'icon-renyuanliyongshuai','color':'purple'},
          'areaTimeStatistics_boss':{'auth':true,'name':'区域时段统计','path':{ path: '/areaTimeStatistics'},'icon':'icon-yeji2','color':'red'},
          'areaMinChargeStatistics_boss':{'auth':true,'name':'区域低消统计','path':{ path: '/areaMinChargeStatistics'},'icon':'icon-xiaofeisongquan','color':'orange'},
          'salesSummary_boss':{'auth':true,'name':'酒水销售汇总','path':{ path: '/salesSummary'},'icon':'icon-jiu','color':'green'},
          'danceRevenue_boss':{'auth':true,'name':'点舞收入','path':{ path: '/danceRevenue'},'icon':'icon-Dancing','color':'blue'},
          'cardRevenue_boss':{'auth':true,'name':'办卡/充值收入','path':{ path: '/cardRevenue'},'icon':'icon-gaoxiaofei','color':'purple'},
          'onAccountStatistics_boss':{'auth':true,'name':'挂账统计','path':{ path: '/onAccountStatistics'},'icon':'icon-xiaofei01','color':'blue'},
          'presentStatisticsDetail_boss':{'auth':true,'name':'赠送统计明细','path':{ path: '/presentStatisticsDetail'},'icon':'icon-zengsong2','color':'red'},
          'presentStatistics_boss':{'auth':true,'name':'赠送酒水统计','path':{ path: '/presentStatistics'},'icon':'icon-zengsong','color':'green'},
          'damagedStatistics_boss':{'auth':true,'name':'破损统计','path':{ path: '/damagedStatistics'},'icon':'icon-clean','color':'purple'},
          'stockData_boss':{'auth':true,'name':'股东数据','path':{ path: '/stockData'},'icon':'icon-kehu1','color':'blue'}
        },
        performanceMenusList:{
          'subscribePerformance_boss':{'auth':true,'name':'订台业绩','path':{ path: '/subscribePerformance'},'icon':'icon-89','color':'purple'},
          'drinksPerformance_boss':{'auth':true,'name':'酒水业绩','path':{ path: '/drinksPerformance'},'icon':'icon-jiushui','color':'green'},
          'orderPerformance_boss':{'auth':true,'name':'点单业绩','path':{ path: '/orderPerformance'},'icon':'icon-wenzhanghuoke-','color':'red'},
          'dancePerformance_boss':{'auth':true,'name':'点舞业绩','path':{ path: '/dancePerformance'},'icon':'icon-wudao2','color':'blue'},
          'drinksRanking_boss':{'auth':true,'name':'酒水销售排行','path':{ path: '/drinksRanking'},'icon':'icon-denglupaihang','color':'orange'},
          'areaRanking_boss':{'auth':true,'name':'区域排行','path':{ path: '/areaRanking'},'icon':'icon-paihang','color':'green'},
          'memberRanking_boss':{'auth':true,'name':'会员排行','path':{ path: '/memberRanking'},'icon':'icon-huiyuanpengyou','color':'purple'},
          'tableSalesRanking_boss':{'auth':true,'name':'台位销售排行','path':{ path: '/tableSalesRanking'},'icon':'icon-paihang1','color':'red'},
          'tableSubscribeRanking_boss':{'auth':true,'name':'台位订位排行','path':{ path: '/tableSubscribeRanking'},'icon':'icon-paihangbang','color':'blue'}
        }
      }
    },
    computed:{
      authority(){
        return this.$store.getters.getAuthority
      }
    },
    methods:{
    },
    mounted(){
      //alert( " 屏幕分辨率的高：" + window.screen.height+ "\n" + " 屏幕分辨率的宽：" + window.screen.width);
      this.$store.commit('updateLoadingStatus',{isLoading:false})
    }
  }
</script>

<style lang="scss" scoped>
  .index{
    .indexIcon{
      text-align: center;position: relative;padding:0.5rem 0.1rem;
      .tips{
        position: absolute;left:6.5rem;top:1.2rem;
        .vux-badge{height:1.5rem;line-height:1.5rem;width:1.5rem;font-size:1rem;border-radius:1rem;}
      }
      .iconfont{
        font-size: 2.5rem;
        &.red{color:rgb(229, 28, 35);}
        &.blue{color:rgb(63, 81, 181);}
        &.lightBlue{color:rgb(0, 150, 136);}
        &.orange{color:rgb(255, 152, 0);}
        &.purple{color:rgb(255, 64, 129);}
        &.green{color:rgb(37, 155, 36);}
        &.lightGreen{color:rgb(139, 195, 74);}
        &.skyBlue{color:rgb(73, 170, 253);}
      }
    }
    .text{margin-top: 0.3rem;font-size: 0.85rem;}
  }
</style>
